home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / TEC 1.2.1 / Sample Code / DropEncoder / Source / Preferences.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-18  |  1.8 KB  |  72 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************
  2. #
  3. #    Preferences.c
  4. #    
  5. #   This code handles loading and saving DropEncoder's preferences into the Preferences
  6. #   folder.
  7. #
  8. #    Author: Timothy Carroll
  9. #    Apple Developer Technical Support
  10. #    timc@apple.com
  11. #
  12. #    Revision: Jason Yeo
  13. #
  14. #    Modification History: 
  15. #
  16. #    2/9/97        TMC     Initial Release
  17. #
  18. #    9/12/97        JY         Updated for:
  19. #                        TEC 1.2.1 
  20. #                        Universal Interfaces 3.0
  21. #                        CodeWarrior 11 projects
  22. #
  23. #    Copyright © 1997 Apple Computer, Inc., All Rights Reserved
  24. #
  25. #
  26. #    You may incorporate this sample code into your applications without
  27. #    restriction, though the sample code has been provided "AS IS" and the
  28. #    responsibility for its operation is 100% yours.  However, what you are
  29. #    not permitted to do is to redistribute the source as "DSC Sample Code"
  30. #    after having made changes. If you're going to re-distribute the source,
  31. #    we require that you make it clear in the source that the code was
  32. #    descended from Apple Sample Code, but that you've made changes.
  33. #
  34. *************************************************************************************/
  35.  
  36. #include "shell.h"
  37. #include "preferences.h"
  38. #include "TextCommon.h"
  39.  
  40. OSStatus ReadPreferencesFile (TPreferences *prefs)
  41. {
  42.  
  43. return paramErr;
  44. }
  45.  
  46. OSStatus WritePreferencesFile (TPreferences *prefs)
  47. {
  48.  
  49. return noErr;
  50. }
  51.  
  52. OSStatus SetDefaultPreferences (TPreferences *prefs)
  53. {
  54.     prefs->version = 0;
  55.     
  56.     // By default, we just go to the default UNICODE.
  57.     prefs->outputEncoding = CreateTextEncoding (kTextEncodingMacJapanese, 
  58.                                                 kTextEncodingDefaultVariant, 
  59.                                                 kTextEncodingDefaultFormat);
  60.                                                 
  61.     prefs->locale = verJapan;
  62.     return noErr;
  63. }
  64.  
  65. OSStatus EditPreferences (TPreferences *prefs)
  66. {
  67.     
  68.     SetDefaultPreferences (prefs);
  69.     WritePreferencesFile (prefs);
  70.     
  71.     return noErr;
  72. }